package org.dandsoft.blackbox.labs.snn;

import org.dandsoft.blackbox.ObjectId;

/**
 * User: dvilyuzhanin
 * Date: 23.01.2009 0:42:40
 */
public class LayerObjectId extends ObjectId {
    private static final long serialVersionUID = 2032817485189079471L;

    private int layerNumber;
    private int id;
    private boolean isNeuron;

    public LayerObjectId(int layerNumber, int id, boolean neuron) {
        this.layerNumber = layerNumber;
        this.id = id;
        isNeuron = neuron;
    }

    public int getLayerNumber() {
        return layerNumber;
    }

    public int getId() {
        return id;
    }

    public boolean isNeuron() {
        return isNeuron;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        LayerObjectId that = (LayerObjectId) o;

        if (id != that.id) return false;
        if (isNeuron != that.isNeuron) return false;
        if (layerNumber != that.layerNumber) return false;

        return true;
    }

    public int hashCode() {
        int result;
        result = layerNumber;
        result = 31 * result + id;
        result = 31 * result + (isNeuron ? 1 : 0);
        return result;
    }


    public String toString() {
        return "LayerObjectId{" +
               "layerNumber=" + layerNumber +
               ", id=" + id +
               ", isNeuron=" + isNeuron +
               '}';
    }
}
